
#include "../GUI.h"
#include "Core/Memory/HeapObject.h"
#include "Core/GUI/Slider/ISlider.h"

#ifndef _GUI_SLIDER_WIN32_
#define _GUI_SLIDER_WIN32_

namespace GUI
{
	namespace Win32
	{
		class Slider : public Core::GUI::ISlider, public Core::Memory::HeapObject
		{
		public:
			Slider(int _iMin, int _iMax, int _iDefaultValue);
			Slider(int _iMin, int _iMax, int _iDefaultValue, int _iWidth, int _iHeight);
			virtual ~Slider();
			void Create(HWND _hWindow, HINSTANCE _hInstance);
			GUI_WIN32 virtual Core::GUI::WidgetType GetType() const;
			GUI_WIN32 virtual int GetId() const;
			GUI_WIN32 virtual int GetWidth() const;
			GUI_WIN32 virtual int GetHeight() const;
			GUI_WIN32 virtual int GetX() const;
			GUI_WIN32 virtual int GetY() const;
			GUI_WIN32 virtual void Resize(int _iWidth, int _iHeight);
			GUI_WIN32 virtual void Move(int _x, int _y);
			GUI_WIN32 virtual void Accept(Core::GUI::IVerticalLayout * _pVerticalLayout);
			GUI_WIN32 virtual void Accept(Core::GUI::IHorizontalLayout * _pHorizontalLayout);
			GUI_WIN32 virtual void OnValueChanged(VoidFunctionInt _function);
			GUI_WIN32 virtual void SetValue(int _iValue);
			GUI_WIN32 virtual int GetValue() const;
			GUI_WIN32 virtual void DecValue();
			GUI_WIN32 virtual void IncValue();

		private:
			HWND m_hSlider;
			int m_iWidth;
			int m_iHeight;
			int m_iX;
			int m_iY;
			int m_iId;
			int m_iMin;
			int m_iMax;
			int m_iDefaultValue;
			int m_iValue;
			VoidFunctionInt m_fctOnValueChanged;

			friend class VerticalLayout;
			friend class HorizontalLayout;
		};
	}
}

#endif // _GUI_SLIDER_WIN32_